Skip to content

interp: add new ini setting 'DISABLE_AUTO_G54_ON_PROGSTOP'#4093

Open
Sigma1912 wants to merge 1 commit into
LinuxCNC:masterfrom
Sigma1912:feature_g54_on_program_stop
Open

interp: add new ini setting 'DISABLE_AUTO_G54_ON_PROGSTOP'#4093
Sigma1912 wants to merge 1 commit into
LinuxCNC:masterfrom
Sigma1912:feature_g54_on_program_stop

Conversation

@Sigma1912
Copy link
Copy Markdown
Contributor

As requested here:
https://forum.linuxcnc.org/38-general-linuxcnc-questions/58821-how-to-remove-automatic-g54-after-m2-m30#346816

Adds a new ini file setting to disable the automatic resetting of the current WCS to G54 on program stop (M2/M30/M99):

[RS274NGC]
DISABLE_AUTO_G54_ON_PROGSTOP = 1

Note:
DISABLE_AUTO_G54_ON_PROGSTOP defaults to '0' so this modification of M2,M30 and M99 behavior is opt-in and default behavior is unchanged.

Comment thread src/emc/rs274ngc/interp_internal.hh Outdated
Comment thread docs/src/config/ini-config.adoc Outdated
@zz912
Copy link
Copy Markdown
Contributor

zz912 commented May 31, 2026

Can I ask you add it in to pncconf?

here:


add:

        print("# When DISABLE_AUTO_G54_ON_PROGSTOP = 1'", file=file)
        print("# M2,M30 and M99 will no longer'", file=file)
        print("# automatically reset the active WCS to 'G54'", file=file)
        print("DISABLE_AUTO_G54_ON_PROGSTOP = 0", file=file)

@zz912
Copy link
Copy Markdown
Contributor

zz912 commented May 31, 2026

I tested main functionality of this PR in Gmoccapy. It works.

@Sigma1912 Sigma1912 force-pushed the feature_g54_on_program_stop branch 4 times, most recently from 42c29ac to 93791ad Compare June 1, 2026 00:01
@Sigma1912
Copy link
Copy Markdown
Contributor Author

@zz912
Added as requested (I made the comment a bit more compact)

@Sigma1912 Sigma1912 changed the title add new ini setting 'DISABLE_AUTO_G54_ON_PROGSTOP' interp: add new ini setting 'DISABLE_AUTO_G54_ON_PROGSTOP' Jun 1, 2026
Comment thread src/emc/usr_intf/pncconf/build_INI.py Outdated
Comment on lines +235 to +237
print("# Set 'DISABLE_AUTO_G54_ON_PROGSTOP = 1' to disable", file=file)
print("# automatic resetting of the active WCS to 'G54' on M2,M30,M99", file=file)
print("DISABLE_AUTO_G54_ON_PROGSTOP = 0", file=file)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be added when the frontend is gmoccapy or always (like the indent now does)?

It is hard to see how @zz912 indented the lines in the comment and it is a bit confusing how they are added to understand where they belong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved those lines to before the ui specific section

@Sigma1912
Copy link
Copy Markdown
Contributor Author

@zz912 could you please clarify whether your requested addition to pncconf was for gmoccapy only or for all guis

@zz912
Copy link
Copy Markdown
Contributor

zz912 commented Jun 1, 2026

I want it for all GUIs. I made wrong numbers of spaces.
Thank you for check.

Adding this to the ini file will disable the automatic resetting of the current WCS to G54 on program stop (M2/M30/M99):

[RS274NGC]
DISABLE_AUTO_G54_ON_PROGSTOP = 1

Note:
DISABLE_AUTO_G54_ON_PROGSTOP defaults to '0' so this modification of M2,M30 and M99 behavior is opt-in and default behavior is unchanged.
@Sigma1912 Sigma1912 force-pushed the feature_g54_on_program_stop branch from 93791ad to 854baf5 Compare June 1, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants